package lv.solcraft.replication.server.scheduler;

import lv.solcraft.replication.server.api.RetryAnalyser;
import lv.solcraft.replication.server.boot.ServerConfig;

public class ScheduledRetryAnalyser implements Scheduled {

    private ServerConfig serverConfig;

    private RetryAnalyser retryAnalyser;

    public void setRetryAnalyser(RetryAnalyser retryAnalyser) {
        this.retryAnalyser = retryAnalyser;
    }

    public void setServerConfig(ServerConfig serverConfig) {
        this.serverConfig = serverConfig;
    }

    public void execute() throws Exception {
        retryAnalyser.execute();
    }

    public String getCron() {
        return serverConfig.getRetryAnalyserCron();
    }
}
